package cn.sitedev.prototype.shallow;

import lombok.Data;

import java.util.List;

/**
 * @author qchen
 * @description 浅克隆
 * @date 2020/9/18 1:21
 */
@Data
public class ConcretePrototype implements Cloneable {
    private int age;
    private String name;
    private List<String> hobbies;

    @Override
    public ConcretePrototype clone() {
        try {
            return (ConcretePrototype) super.clone();
        } catch (CloneNotSupportedException e) {
            e.printStackTrace();
        }
        return null;
    }
}
